package Lab8;

public class FindMax {
    public static void main(String args[]){
        int[] l = {178, 33, 4, 2, -3, 5};
        System.out.println(max(l, 0, l.length-1));
    }

    static int max(int[] n, int start, int end){
        if(start==end)
            return n[0];
        if(start+1==end)
            return n[0]>n[1]? n[0] : n[1];

        int mid = (start+end)/2;
        int m1 = max(n, start, mid);
        int m2 = max(n, mid+1, end);

        return m1>m2? m1:m2;
    }


}
